<?php
session_start();
if($_SESSION['fl']!=1)
{
	header("Location:admin.php");
}



?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<?php 


$con=mysql_connect('localhost','root','');
if(!$con)
{
  die('could not connect:'.mysql_error());
  }
  mysql_select_db("ETrawelMart",$con);
  
  $userid=$_POST['login'];
  $password=$_POST['paswrd'];
  
  $check=mysql_query("SELECT password FROM adminlogin WHERE admin_id= '$userid' ");
  
  $row=mysql_fetch_array($check);
  $pass=$row['password'];
  $flag=1;
  $_SESSION['fl']=$flag;
  
  
  	  if($pass==$password )
	  {
		 $_SESSION['$user']=$userid;
		  header('Location:admin1.php');	  
		  
	  }
	 
  else
   	  {
		  ?>
	    <script language="javascript"> 
		 alert("You have entered an invalid ID or password"); window.location.href='admin.php'; </script>
          <?php
	    
	  
	  }
?>
<body>

</body>
</html>